package kmi.square.wallpaper;

import kmi.droid.livewallpaper.gl.GLWallpaperService;
import android.content.SharedPreferences;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;

public class Test extends GLWallpaperService
{
	public Test()
	{
		super();
	}

	public Engine onCreateEngine()
	{
		MyEngine engine = new MyEngine();
		return engine;
	}

	// prefs and sensor interface is optional, just showing that this is where
	// you do all of that - everything that would normally be in an activity is
	// in here.
	class MyEngine extends GLEngine implements
			SharedPreferences.OnSharedPreferenceChangeListener,
			SensorEventListener
	{
		MyRenderer renderer;

		public MyEngine()
		{
			super();
			// handle prefs, other initialization
			renderer = new MyRenderer();
			setRenderer(renderer);
			setRenderMode(RENDERMODE_WHEN_DIRTY);
		}

		public void onDestroy()
		{
			super.onDestroy();
			if (renderer != null)
			{
				renderer.release(); // assuming yours has this method - it
									// should!
			}
			renderer = null;
		}

		public void onAccuracyChanged(Sensor arg0, int arg1)
		{
			// TODO Auto-generated method stub
			
		}

		public void onSensorChanged(SensorEvent arg0)
		{
			// TODO Auto-generated method stub
			
		}

		public void onSharedPreferenceChanged(
				SharedPreferences sharedPreferences, String key)
		{
			// TODO Auto-generated method stub
			
		}
	}
}